package class03_一些基础的数据结构.test;

public class Code08_GetMax {
    public static int getMax(int[] arr){
        return process(arr, 0, arr.length - 1);
    }
    private static int process(int[] arr, int L, int R) {
        if(L == R){
            return arr[L];
        }
        int mid = L + ((R - L) >> 2);
        int left = process(arr, L, mid );
        int right = process(arr, mid + 1, R);
        return Math.max(left,right);
    }

    public static void main(String[] args) {
        int[] arr = new int[]{3,1,2,4,5,6,9,8,7,66,55,44,55};
        System.out.println(getMax(arr));
    }
}
